﻿using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.UC.门店出入库.Service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.门店出入库.UC
{
    public partial class XtraUserControl柱状图 : DevExpress.XtraEditors.XtraUserControl
    {
        public XtraUserControl柱状图()
        {
            InitializeComponent();
            this.chartControl1.BeginInit();

            List<StockChartDTO> stockChartDTOs = FunctionHelper.JsonDeserialization<List<StockChartDTO>>("[{\"quantity\":172,\"styleNameCn\":\"21F68 女大圆领五分袖T恤\"},{\"quantity\":99,\"styleNameCn\":\"20FS13 20FS13吊带长裙\"},{\"quantity\":94,\"styleNameCn\":\"21F51-2 女U型领五分袖修身加长T恤\"},{\"quantity\":76,\"styleNameCn\":\"21FP11-5 女休闲小脚裤\"},{\"quantity\":63,\"styleNameCn\":\"19FP5 女休闲微喇裤\"},{\"quantity\":55,\"styleNameCn\":\"21F41 女休闲圆领短袖衫\"},{\"quantity\":51,\"styleNameCn\":\"7068 女前开衩喇叭牛仔裤\"},{\"quantity\":44,\"styleNameCn\":\"20F71-2 深圆领宽肩带背心\"},{\"quantity\":36,\"styleNameCn\":\"22FS04 女中长圆领双兜A摆连衣裙\"},{\"quantity\":33,\"styleNameCn\":\"20FJ145-4 女中长款修身戗驳头双排2粒扣西服\"}]");
            //List<StockChartDTO> stockChartDTOs = 出入库Service.getWaitStickInTop10List();
            foreach (StockChartDTO item in stockChartDTOs)
            {
                try { item.styleNameCn = item.styleNameCn.Replace(" .*", ""); } catch { }
            }
            this.chartControl1.DataSource = stockChartDTOs;
            this.chartControl1.EndInit();
        }
    }
}
